﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Datas
{
    public sealed class Singleton
    {
        private static volatile Singleton instance;
        private static object syncRoot = new Object();

        // Real Data Here
        
        // Player GameObject
        public Player playerRole;
        // Enemy GameObjects
        public ArrayList enemyRoles;
        // Food GameObjects
        public ArrayList foods;
        
        // Read Data Ends

        private Singleton() {
            this.enemyRoles = new ArrayList();
        }

        public static Singleton Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                            instance = new Singleton();
                    }
                }

                return instance;
            }
        }
    }
}